import Vue from "vue"
import VueRouter from "vue-router"

const ChatHome = () => import('../pages/home.vue')
const UserLogin = () => import('../pages/login.vue')
const UserRegister = () => import('../pages/register.vue')
const UserHistory = () => import('../pages/history.vue')

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      component: ChatHome
    },
    {
      path: '/login',
      component: UserLogin
    },
    {
      path: '/register',
      component: UserRegister
    },
    {
      path: '/history',
      component: UserHistory
    }
  ]
})

export default router